Add SyncMatchOutcome to hooks API with rate limiting signal#10045
Open
rkannan82 wants to merge 11 commits intokannan/sync-match-result-structfrom
Open
Add SyncMatchOutcome to hooks API with rate limiting signal#10045rkannan82 wants to merge 11 commits intokannan/sync-match-result-structfrom
rkannan82 wants to merge 11 commits intokannan/sync-match-result-structfrom
Conversation
This was referenced Apr 23, 2026
a3d7db8 to
6513520
Compare
deffb5f to
ae105f9
Compare
ShahabT
reviewed
Apr 28, 2026
ae105f9 to
982f720
Compare
5fdd8bd to
359d5e2
Compare
5334077 to
4d0329d
Compare
Add NoMatchReasonRateLimited to the NoMatchReason enum. When findAndWakeMatches detects rate limiting, MatchTaskImmediately returns this reason, which flows through Offer → TrySyncMatch → processTaskAddHooks. At the hooks boundary, internal NoMatchReason is translated to hooks.NoMatchReason (which only exposes Unspecified and RateLimited). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4d0329d to
7e66f5f
Compare
rkannan82
commented
Apr 29, 2026
| var result syncMatchResult | ||
| result, err = syncMatchQueue.TrySyncMatch(ctx, syncMatchTask) | ||
| syncMatched = result.matched | ||
| // TODO: TrySyncMatch returns matched=true with a start error (e.g. busy workflow), |
Contributor
Author
Resolve merge conflicts after parent PR switched from syncMatchResult struct to syncMatchOutcome enum. Add syncMatchRateLimited to the enum and update all references. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the IsSyncMatch bool and NoMatchReason enum with a single SyncMatchOutcome enum in the hooks API. The internal syncMatchOutcome is translated to the hooks-specific enum at the boundary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Retain the IsSyncMatch bool field in TaskAddHookDetails, derived from SyncMatchOutcome, so existing hook consumers are not broken. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensures uninitialized SyncMatchOutcome fields are distinguishable from intentional NotMatched values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…imited-to-task-hook-v2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Map syncMatchUnspecified to hooks.SyncMatchOutcomeUnspecified so the bug signal propagates rather than being silently mapped to NotMatched. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
SyncMatchOutcomeenum to the hooks API (NotMatched, Success, RateLimited) and plumb rate limiting signal from the matcher through to hooks. KeepIsSyncMatchas deprecated for backwards compatibility.Why
Hook consumers (e.g. scaling operators) need to distinguish rate limiting from genuine lack of pollers when deciding whether to scale up workers.
How did you test it?
Unit tests — rate-limited and non-rate-limited scenarios, multiple hooks invocation.
🤖 Generated with Claude Code